{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "TuriCreate Crash Course and ML Tutorial.ipynb",
      "provenance": [],
      "collapsed_sections": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "eCi02iBxjALw"
      },
      "source": [
        "### TuriCreate Crash Course\n",
        "+ TuriCreate\n",
        "  - made by Apple\n",
        "\n",
        "#### Task\n",
        "+ Basics\n",
        "  - How to read csv files\n",
        "  - How to create dataframes\n",
        "  - Basic Data Manipulation\n",
        "+ Text Classification with ML\n",
        "  - Disaster classifier\n",
        "\n",
        "#### Installation\n",
        "+ pip install turicreate\n",
        "\n",
        "\n",
        "#### Features\n",
        "+ Easy-to-use: Focus on tasks instead of algorithms\n",
        "+ Visual: Built-in, streaming visualizations to explore your data\n",
        "+ Flexible: Supports text, images, audio, video and sensor data\n",
        "+ Fast and Scalable: Work with large datasets on a single machine\n",
        "+ Ready To Deploy: Export models to Core ML for use in iOS, macOS, watchOS, and tvOS apps"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "eiF3fQJOi1P9",
        "outputId": "da965c83-e3a8-4756-b3b8-bada65646624"
      },
      "source": [
        "!pip install turicreate"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Collecting turicreate\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/25/9f/a76acc465d873d217f05eac4846bd73d640b9db6d6f4a3c29ad92650fbbe/turicreate-6.4.1-cp37-cp37m-manylinux1_x86_64.whl (92.0MB)\n",
            "\u001b[K     |████████████████████████████████| 92.0MB 46kB/s \n",
            "\u001b[?25hRequirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.7/dist-packages (from turicreate) (1.15.0)\n",
            "Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from turicreate) (1.19.5)\n",
            "Requirement already satisfied: pillow>=5.2.0 in /usr/local/lib/python3.7/dist-packages (from turicreate) (7.1.2)\n",
            "Requirement already satisfied: requests>=2.9.1 in /usr/local/lib/python3.7/dist-packages (from turicreate) (2.23.0)\n",
            "Collecting coremltools==3.3\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/1b/1d/b1a99beca7355b6a026ae61fd8d3d36136e5b36f13e92ec5f81aceffc7f1/coremltools-3.3-cp37-none-manylinux1_x86_64.whl (3.5MB)\n",
            "\u001b[K     |████████████████████████████████| 3.5MB 31.5MB/s \n",
            "\u001b[?25hRequirement already satisfied: pandas>=0.23.2 in /usr/local/lib/python3.7/dist-packages (from turicreate) (1.1.5)\n",
            "Requirement already satisfied: decorator>=4.0.9 in /usr/local/lib/python3.7/dist-packages (from turicreate) (4.4.2)\n",
            "Collecting resampy==0.2.1\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/14/b6/66a06d85474190b50aee1a6c09cdc95bb405ac47338b27e9b21409da1760/resampy-0.2.1.tar.gz (322kB)\n",
            "\u001b[K     |████████████████████████████████| 327kB 56.6MB/s \n",
            "\u001b[?25hRequirement already satisfied: scipy>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from turicreate) (1.4.1)\n",
            "Collecting tensorflow<2.1.0,>=2.0.0\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/3c/b3/3eeae9bc44039ceadceac0c7ba1cc8b1482b172810b3d7624a1cad251437/tensorflow-2.0.4-cp37-cp37m-manylinux2010_x86_64.whl (86.4MB)\n",
            "\u001b[K     |████████████████████████████████| 86.4MB 50kB/s \n",
            "\u001b[?25hCollecting numba<0.51.0\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/04/be/8c88cee3366de2a3a23a9ff1a8be34e79ad1eb1ceb0d0e33aca83655ac3c/numba-0.50.1-cp37-cp37m-manylinux2014_x86_64.whl (3.6MB)\n",
            "\u001b[K     |████████████████████████████████| 3.6MB 27.4MB/s \n",
            "\u001b[?25hCollecting prettytable==0.7.2\n",
            "  Downloading https://files.pythonhosted.org/packages/ef/30/4b0746848746ed5941f052479e7c23d2b56d174b82f4fd34a25e389831f5/prettytable-0.7.2.tar.bz2\n",
            "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests>=2.9.1->turicreate) (3.0.4)\n",
            "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests>=2.9.1->turicreate) (2.10)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests>=2.9.1->turicreate) (2020.12.5)\n",
            "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests>=2.9.1->turicreate) (1.24.3)\n",
            "Requirement already satisfied: protobuf>=3.1.0 in /usr/local/lib/python3.7/dist-packages (from coremltools==3.3->turicreate) (3.12.4)\n",
            "Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.23.2->turicreate) (2018.9)\n",
            "Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.23.2->turicreate) (2.8.1)\n",
            "Requirement already satisfied: h5py<=2.10.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (2.10.0)\n",
            "Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (0.12.0)\n",
            "Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (1.12.1)\n",
            "Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (0.8.1)\n",
            "Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (1.1.2)\n",
            "Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (1.1.0)\n",
            "Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (0.2.0)\n",
            "Collecting gast==0.2.2\n",
            "  Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz\n",
            "Collecting tensorboard<2.1.0,>=2.0.0\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/76/54/99b9d5d52d5cb732f099baaaf7740403e83fe6b0cedde940fabd2b13d75a/tensorboard-2.0.2-py3-none-any.whl (3.8MB)\n",
            "\u001b[K     |████████████████████████████████| 3.8MB 29.5MB/s \n",
            "\u001b[?25hRequirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (1.32.0)\n",
            "Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (3.3.0)\n",
            "Requirement already satisfied: wheel>=0.26; python_version >= \"3\" in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.1.0,>=2.0.0->turicreate) (0.36.2)\n",
            "Collecting tensorflow-estimator<2.1.0,>=2.0.0\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/fc/08/8b927337b7019c374719145d1dceba21a8bb909b93b1ad6f8fb7d22c1ca1/tensorflow_estimator-2.0.1-py2.py3-none-any.whl (449kB)\n",
            "\u001b[K     |████████████████████████████████| 450kB 49.7MB/s \n",
            "\u001b[?25hCollecting keras-applications>=1.0.8\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)\n",
            "\u001b[K     |████████████████████████████████| 51kB 7.3MB/s \n",
            "\u001b[?25hRequirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from numba<0.51.0->turicreate) (56.1.0)\n",
            "Collecting llvmlite<0.34,>=0.33.0.dev0\n",
            "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/0a/28/0a35b3c2685bf2ea327cef5577bdf91f387f0f4594417a2a05a1d42fb7c2/llvmlite-0.33.0-cp37-cp37m-manylinux1_x86_64.whl (18.3MB)\n",
            "\u001b[K     |████████████████████████████████| 18.3MB 249kB/s \n",
            "\u001b[?25hRequirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (3.3.4)\n",
            "Requirement already satisfied: google-auth<2,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (1.30.0)\n",
            "Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (0.4.4)\n",
            "Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (2.0.0)\n",
            "Requirement already satisfied: importlib-metadata; python_version < \"3.8\" in /usr/local/lib/python3.7/dist-packages (from markdown>=2.6.8->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (4.0.1)\n",
            "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (0.2.8)\n",
            "Requirement already satisfied: rsa<5,>=3.1.4; python_version >= \"3.6\" in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (4.7.2)\n",
            "Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (4.2.2)\n",
            "Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (1.3.0)\n",
            "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata; python_version < \"3.8\"->markdown>=2.6.8->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (3.4.1)\n",
            "Requirement already satisfied: typing-extensions>=3.6.4; python_version < \"3.8\" in /usr/local/lib/python3.7/dist-packages (from importlib-metadata; python_version < \"3.8\"->markdown>=2.6.8->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (3.7.4.3)\n",
            "Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /usr/local/lib/python3.7/dist-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (0.4.8)\n",
            "Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.1.0,>=2.0.0->tensorflow<2.1.0,>=2.0.0->turicreate) (3.1.0)\n",
            "Building wheels for collected packages: resampy, prettytable, gast\n",
            "  Building wheel for resampy (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for resampy: filename=resampy-0.2.1-cp37-none-any.whl size=320845 sha256=6f6d22835e8832e30e279f9118378ef999a8adb03d777e97af9e6ccf8dac7a2f\n",
            "  Stored in directory: /root/.cache/pip/wheels/ff/4f/ed/2e6c676c23efe5394bb40ade50662e90eb46e29b48324c5f9b\n",
            "  Building wheel for prettytable (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for prettytable: filename=prettytable-0.7.2-cp37-none-any.whl size=13700 sha256=a85a21da31495a2f699a579b1efc552e45fab1ee2d2603a1e2544311119b054b\n",
            "  Stored in directory: /root/.cache/pip/wheels/80/34/1c/3967380d9676d162cb59513bd9dc862d0584e045a162095606\n",
            "  Building wheel for gast (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for gast: filename=gast-0.2.2-cp37-none-any.whl size=7540 sha256=b3758188b80efd6081595317b466483f901aab12dc7277e1a45c66e4e00c282f\n",
            "  Stored in directory: /root/.cache/pip/wheels/5c/2e/7e/a1d4d4fcebe6c381f378ce7743a3ced3699feb89bcfbdadadd\n",
            "Successfully built resampy prettytable gast\n",
            "\u001b[31mERROR: tensorflow 2.0.4 has requirement numpy<1.19.0,>=1.16.0, but you'll have numpy 1.19.5 which is incompatible.\u001b[0m\n",
            "\u001b[31mERROR: tensorflow-probability 0.12.1 has requirement gast>=0.3.2, but you'll have gast 0.2.2 which is incompatible.\u001b[0m\n",
            "\u001b[31mERROR: librosa 0.8.0 has requirement resampy>=0.2.2, but you'll have resampy 0.2.1 which is incompatible.\u001b[0m\n",
            "Installing collected packages: coremltools, llvmlite, numba, resampy, gast, tensorboard, tensorflow-estimator, keras-applications, tensorflow, prettytable, turicreate\n",
            "  Found existing installation: llvmlite 0.34.0\n",
            "    Uninstalling llvmlite-0.34.0:\n",
            "      Successfully uninstalled llvmlite-0.34.0\n",
            "  Found existing installation: numba 0.51.2\n",
            "    Uninstalling numba-0.51.2:\n",
            "      Successfully uninstalled numba-0.51.2\n",
            "  Found existing installation: resampy 0.2.2\n",
            "    Uninstalling resampy-0.2.2:\n",
            "      Successfully uninstalled resampy-0.2.2\n",
            "  Found existing installation: gast 0.3.3\n",
            "    Uninstalling gast-0.3.3:\n",
            "      Successfully uninstalled gast-0.3.3\n",
            "  Found existing installation: tensorboard 2.4.1\n",
            "    Uninstalling tensorboard-2.4.1:\n",
            "      Successfully uninstalled tensorboard-2.4.1\n",
            "  Found existing installation: tensorflow-estimator 2.4.0\n",
            "    Uninstalling tensorflow-estimator-2.4.0:\n",
            "      Successfully uninstalled tensorflow-estimator-2.4.0\n",
            "  Found existing installation: tensorflow 2.4.1\n",
            "    Uninstalling tensorflow-2.4.1:\n",
            "      Successfully uninstalled tensorflow-2.4.1\n",
            "  Found existing installation: prettytable 2.1.0\n",
            "    Uninstalling prettytable-2.1.0:\n",
            "      Successfully uninstalled prettytable-2.1.0\n",
            "Successfully installed coremltools-3.3 gast-0.2.2 keras-applications-1.0.8 llvmlite-0.33.0 numba-0.50.1 prettytable-0.7.2 resampy-0.2.1 tensorboard-2.0.2 tensorflow-2.0.4 tensorflow-estimator-2.0.1 turicreate-6.4.1\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "qZT3cNcQl_xl"
      },
      "source": [
        "# Load Pkgs\n",
        "import turicreate as tc"
      ],
      "execution_count": 2,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "qZyuJsH4mV0O",
        "outputId": "8c427116-0bc0-4cc3-b0d1-eb0cfe5c6082"
      },
      "source": [
        "# Methods/Attrib\n",
        "dir(tc)"
      ],
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "['Edge',\n",
              " 'Image',\n",
              " 'SArray',\n",
              " 'SArrayBuilder',\n",
              " 'SFrame',\n",
              " 'SFrameBuilder',\n",
              " 'SGraph',\n",
              " 'Sketch',\n",
              " 'Vertex',\n",
              " '_',\n",
              " '__builtins__',\n",
              " '__cached__',\n",
              " '__doc__',\n",
              " '__file__',\n",
              " '__loader__',\n",
              " '__name__',\n",
              " '__package__',\n",
              " '__path__',\n",
              " '__spec__',\n",
              " '__version__',\n",
              " '_connect',\n",
              " '_cython',\n",
              " '_deps',\n",
              " '_extensions_wrapper',\n",
              " '_launch',\n",
              " '_scripts',\n",
              " '_sys',\n",
              " '_sys_util',\n",
              " 'activity_classifier',\n",
              " 'aggregate',\n",
              " 'boosted_trees_classifier',\n",
              " 'boosted_trees_regression',\n",
              " 'classifier',\n",
              " 'clustering',\n",
              " 'config',\n",
              " 'connected_components',\n",
              " 'data_structures',\n",
              " 'dbscan',\n",
              " 'decision_tree_classifier',\n",
              " 'decision_tree_regression',\n",
              " 'degree_counting',\n",
              " 'distances',\n",
              " 'drawing_classifier',\n",
              " 'evaluation',\n",
              " 'extensions',\n",
              " 'factorization_recommender',\n",
              " 'graph_analytics',\n",
              " 'graph_coloring',\n",
              " 'image_analysis',\n",
              " 'image_classifier',\n",
              " 'image_similarity',\n",
              " 'item_content_recommender',\n",
              " 'item_similarity_recommender',\n",
              " 'kcore',\n",
              " 'kmeans',\n",
              " 'label_propagation',\n",
              " 'linear_regression',\n",
              " 'load_audio',\n",
              " 'load_images',\n",
              " 'load_model',\n",
              " 'load_sarray',\n",
              " 'load_sframe',\n",
              " 'load_sgraph',\n",
              " 'logistic_classifier',\n",
              " 'nearest_neighbor_classifier',\n",
              " 'nearest_neighbors',\n",
              " 'object_detector',\n",
              " 'one_shot_object_detector',\n",
              " 'pagerank',\n",
              " 'plot',\n",
              " 'popularity_recommender',\n",
              " 'random_forest_classifier',\n",
              " 'random_forest_regression',\n",
              " 'ranking_factorization_recommender',\n",
              " 'recommender',\n",
              " 'regression',\n",
              " 'shortest_path',\n",
              " 'show',\n",
              " 'sound_classifier',\n",
              " 'style_transfer',\n",
              " 'svm_classifier',\n",
              " 'text_analytics',\n",
              " 'text_classifier',\n",
              " 'toolkits',\n",
              " 'topic_model',\n",
              " 'triangle_counting',\n",
              " 'turicreate',\n",
              " 'util',\n",
              " 'version_info',\n",
              " 'visualization']"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 3
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "quqKGO3jmYhQ"
      },
      "source": [
        "# How to Create Dataframe\n",
        "+ SFrame is a scalable, tabular, column-mutable dataframe object."
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "xudfNEHFmqsH"
      },
      "source": [
        "# Method 1: How to create a dataframe from dictionary\n",
        "df1 = tc.SFrame({'text':['there was an earthquake last year']})"
      ],
      "execution_count": 4,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 92
        },
        "id": "_OpQEWHlm-zy",
        "outputId": "376f3499-95be-480f-9ac5-19a606fd0f0d"
      },
      "source": [
        "df1"
      ],
      "execution_count": 5,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">there was an earthquake<br>last year ...</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[1 rows x 1 columns]<br/>\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\ttext\tstr\n",
              "\n",
              "Rows: 1\n",
              "\n",
              "Data:\n",
              "+-------------------------------+\n",
              "|              text             |\n",
              "+-------------------------------+\n",
              "| there was an earthquake la... |\n",
              "+-------------------------------+\n",
              "[1 rows x 1 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 5
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "4YcoQQCrm_z0"
      },
      "source": [
        "# Method 2: From Pandas\n",
        "import pandas as pd\n",
        "df = pd.DataFrame({'age':[1,2,3,4,5]})"
      ],
      "execution_count": 6,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 198
        },
        "id": "8J9AW_TwnXHA",
        "outputId": "85d6025e-1c41-4050-8d75-08fed797b094"
      },
      "source": [
        "df"
      ],
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>age</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>2</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>3</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>4</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>5</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   age\n",
              "0    1\n",
              "1    2\n",
              "2    3\n",
              "3    4\n",
              "4    5"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 7
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "DJ5JaNb2nYEG"
      },
      "source": [
        "df2 = tc.SFrame(data=df)"
      ],
      "execution_count": 8,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 151
        },
        "id": "a6Nvy4UOncnM",
        "outputId": "070d28d3-c997-4963-dabf-410a2803930c"
      },
      "source": [
        "df2"
      ],
      "execution_count": 9,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">age</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">2</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">3</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[5 rows x 1 columns]<br/>\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tage\tint\n",
              "\n",
              "Rows: 5\n",
              "\n",
              "Data:\n",
              "+-----+\n",
              "| age |\n",
              "+-----+\n",
              "|  1  |\n",
              "|  2  |\n",
              "|  3  |\n",
              "|  4  |\n",
              "|  5  |\n",
              "+-----+\n",
              "[5 rows x 1 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 9
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "GCf1ZYGtne7q",
        "outputId": "e07228d2-05a0-4e18-8738-6ae352418810"
      },
      "source": [
        "print(type(df))\n",
        "print(type(df2))"
      ],
      "execution_count": 10,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "<class 'pandas.core.frame.DataFrame'>\n",
            "<class 'turicreate.data_structures.sframe.SFrame'>\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 214
        },
        "id": "wNlrQcAHnkDI",
        "outputId": "65a722da-fe05-47f4-842b-937fb6b482ae"
      },
      "source": [
        "# Reading Data From CSV\n",
        "df = tc.SFrame('disaster_tweets.csv')"
      ],
      "execution_count": 11,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<pre>Finished parsing file /content/disaster_tweets.csv</pre>"
            ],
            "text/plain": [
              "Finished parsing file /content/disaster_tweets.csv"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<pre>Parsing completed. Parsed 100 lines in 0.066992 secs.</pre>"
            ],
            "text/plain": [
              "Parsing completed. Parsed 100 lines in 0.066992 secs."
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "------------------------------------------------------\n",
            "Inferred types from first 100 line(s) of file as \n",
            "column_type_hints=[int,str,str,str,int]\n",
            "If parsing fails due to incorrect types, you can correct\n",
            "the inferred type list above and pass it to read_csv in\n",
            "the column_type_hints argument\n",
            "------------------------------------------------------\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<pre>Finished parsing file /content/disaster_tweets.csv</pre>"
            ],
            "text/plain": [
              "Finished parsing file /content/disaster_tweets.csv"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<pre>Parsing completed. Parsed 7613 lines in 0.031073 secs.</pre>"
            ],
            "text/plain": [
              "Parsing completed. Parsed 7613 lines in 0.031073 secs."
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 419
        },
        "id": "KBuLwLKpn5ec",
        "outputId": "9c93cb21-84d5-4137-f4a4-a94227b18099"
      },
      "source": [
        "# Display/Preview\n",
        "df.head()"
      ],
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">id</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">keyword</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">location</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">6</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">7</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">8</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">10</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">14</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">15</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[10 rows x 5 columns]<br/>\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tid\tint\n",
              "\tkeyword\tstr\n",
              "\tlocation\tstr\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 10\n",
              "\n",
              "Data:\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "| id | keyword | location |              text             | target |\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "| 1  |         |          | Our Deeds are the Reason o... |   1    |\n",
              "| 4  |         |          | Forest fire near La Ronge ... |   1    |\n",
              "| 5  |         |          | All residents asked to 'sh... |   1    |\n",
              "| 6  |         |          | 13,000 people receive #wil... |   1    |\n",
              "| 7  |         |          | Just got sent this photo f... |   1    |\n",
              "| 8  |         |          | #RockyFire Update => Calif... |   1    |\n",
              "| 10 |         |          | #flood #disaster Heavy rai... |   1    |\n",
              "| 13 |         |          | I'm on top of the hill and... |   1    |\n",
              "| 14 |         |          | There's an emergency evacu... |   1    |\n",
              "| 15 |         |          | I'm afraid that the tornad... |   1    |\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "[10 rows x 5 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 237
        },
        "id": "WyQumwSpn9rx",
        "outputId": "e861c594-f619-4328-b579-19e282452217"
      },
      "source": [
        "# Display 5 rows\n",
        "df.head(5)"
      ],
      "execution_count": 13,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">id</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">keyword</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">location</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">6</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">7</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[5 rows x 5 columns]<br/>\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tid\tint\n",
              "\tkeyword\tstr\n",
              "\tlocation\tstr\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 5\n",
              "\n",
              "Data:\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "| id | keyword | location |              text             | target |\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "| 1  |         |          | Our Deeds are the Reason o... |   1    |\n",
              "| 4  |         |          | Forest fire near La Ronge ... |   1    |\n",
              "| 5  |         |          | All residents asked to 'sh... |   1    |\n",
              "| 6  |         |          | 13,000 people receive #wil... |   1    |\n",
              "| 7  |         |          | Just got sent this photo f... |   1    |\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "[5 rows x 5 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 13
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "BoDO7pB2oC8C",
        "outputId": "987169de-32b2-45b0-cb74-5263590be791"
      },
      "source": [
        "# Check For Shape\n",
        "df.shape"
      ],
      "execution_count": 14,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "(7613, 5)"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 14
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "XgfSApTkoGna",
        "outputId": "4dce71df-067d-4765-a5f9-f148a7d2b0f2"
      },
      "source": [
        "# Number of col\n",
        "df.num_columns()"
      ],
      "execution_count": 16,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "5"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 16
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "5O6b6eWioJX7",
        "outputId": "5ac7d8dc-da03-4eab-8fac-5d504ab34820"
      },
      "source": [
        "# Num of Rows\n",
        "df.num_rows()"
      ],
      "execution_count": 18,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "7613"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 18
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "B2YAffbroPD8",
        "outputId": "ea9c03c3-2c71-4d12-ff93-3515a2ee9855"
      },
      "source": [
        "# Check For COlumn Names\n",
        "df.column_names()"
      ],
      "execution_count": 19,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "['id', 'keyword', 'location', 'text', 'target']"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 19
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "p86J2msroU8k",
        "outputId": "ada7c33e-2d43-4434-f55c-2b24d0c271f2"
      },
      "source": [
        "# Datatype\n",
        "# Method 1\n",
        "df.column_types()"
      ],
      "execution_count": 20,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[int, str, str, str, int]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 20
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "MaCyFQY-oZDh",
        "outputId": "7a231c5a-ef8e-4b4f-f026-b85c23a510f1"
      },
      "source": [
        "# Check For Datatypes\n",
        "# Method 2\n",
        "df.dtype"
      ],
      "execution_count": 22,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "[int, str, str, str, int]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 22
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "clmPXe9mogAA",
        "outputId": "755b1b6d-8ab0-4d75-b5a9-61da548c9794"
      },
      "source": [
        "### Selection of Columns\n",
        "df['text']"
      ],
      "execution_count": 23,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "dtype: str\n",
              "Rows: 7613\n",
              "['Our Deeds are the Reason of this #earthquake May ALLAH Forgive us all', 'Forest fire near La Ronge Sask. Canada', \"All residents asked to 'shelter in place' are being notified by officers. No other evacuation or shelter in place orders are expected\", '13,000 people receive #wildfires evacuation orders in California ', 'Just got sent this photo from Ruby #Alaska as smoke from #wildfires pours into a school', '#RockyFire Update => California Hwy. 20 closed in both directions due to Lake County fire - #CAfire #wildfires', '#flood #disaster Heavy rain causes flash flooding of streets in Manitou, Colorado Springs areas', \"I'm on top of the hill and I can see a fire in the woods...\", \"There's an emergency evacuation happening now in the building across the street\", \"I'm afraid that the tornado is coming to our area...\", 'Three people died from the heat wave so far', 'Haha South Tampa is getting flooded hah- WAIT A SECOND I LIVE IN SOUTH TAMPA WHAT AM I GONNA DO WHAT AM I GONNA DO FVCK #flooding', \"#raining #flooding #Florida #TampaBay #Tampa 18 or 19 days. I've lost count\", '#Flood in Bago Myanmar #We arrived Bago', 'Damage to school bus on 80 in multi car crash #BREAKING', \"What's up man?\", 'I love fruits', 'Summer is lovely', 'My car is so fast', 'What a goooooooaaaaaal!!!!!!', 'this is ridiculous....', 'London is cool ;)', 'Love skiing', 'What a wonderful day!', 'LOOOOOOL', \"No way...I can't eat that shit\", 'Was in NYC last week!', 'Love my girlfriend', 'Cooool :)', 'Do you like pasta?', 'The end!', '@bbcmtd Wholesale Markets ablaze http://t.co/lHYXEOHY6C', 'We always try to bring the heavy. #metal #RT http://t.co/YAo1e0xngw', '#AFRICANBAZE: Breaking news:Nigeria flag set ablaze in Aba. http://t.co/2nndBGwyEi', 'Crying out for more! Set me ablaze', 'On plus side LOOK AT THE SKY LAST NIGHT IT WAS ABLAZE http://t.co/qqsmshaJ3N', \"@PhDSquares #mufc they've built so much hype around new acquisitions but I doubt they will set the EPL ablaze this season.\", 'INEC Office in Abia Set Ablaze - http://t.co/3ImaomknnA', 'Barbados #Bridgetown JAMAICA \\x89ÛÒ Two cars set ablaze: SANTA CRUZ \\x89ÛÓ Head of the St Elizabeth Police Superintende...  http://t.co/wDUEaj8Q4J', 'Ablaze for you Lord :D', 'Check these out: http://t.co/rOI2NSmEJJ http://t.co/3Tj8ZjiN21 http://t.co/YDUiXEfIpE http://t.co/LxTjc87KLS #nsfw', \"on the outside you're ablaze and alive\\nbut you're dead inside\", 'Had an awesome time visiting the CFC head office the ancop site and ablaze. Thanks to Tita Vida for taking care of us ??', 'SOOOO PUMPED FOR ABLAZE ???? @southridgelife', 'I wanted to set Chicago ablaze with my preaching... But not my hotel! http://t.co/o9qknbfOFX', 'I gained 3 followers in the last week. You? Know your stats and grow with http://t.co/TIyUliF5c6', 'How the West was burned: Thousands of wildfires ablaze in California alone http://t.co/vl5TBR3wbr', 'Building the perfect tracklist to life leave the streets ablaze', 'Check these out: http://t.co/rOI2NSmEJJ http://t.co/3Tj8ZjiN21 http://t.co/YDUiXEfIpE http://t.co/LxTjc87KLS #nsfw', \"First night with retainers in. It's quite weird. Better get used to it; I have to wear them every single night for the next year at least.\", 'Deputies: Man shot before Brighton home set ablaze http://t.co/gWNRhMSO8k', 'Man wife get six years jail for setting ablaze niece\\nhttp://t.co/eV1ahOUCZA', 'SANTA CRUZ \\x89ÛÓ Head of the St Elizabeth Police Superintendent Lanford Salmon has r ... - http://t.co/vplR5Hka2u http://t.co/SxHW2TNNLf', 'Police: Arsonist Deliberately Set Black Church In North CarolinaåÊAblaze http://t.co/pcXarbH9An', \"Noches El-Bestia '@Alexis_Sanchez: happy to see my teammates and training hard ?? goodnight gunners.?????? http://t.co/uc4j4jHvGR'\", '#Kurds trampling on Turkmen flag later set it ablaze while others vandalized offices of Turkmen Front in #Diyala http://t.co/4IzFdYC3cg', 'TRUCK ABLAZE : R21. VOORTREKKER AVE. OUTSIDE OR TAMBO INTL. CARGO SECTION. http://t.co/8kscqKfKkF', 'Set our hearts ablaze and every city was a gift And every skyline was like a kiss upon the lips @\\x89Û_ https://t.co/cYoMPZ1A0Z', \"They sky was ablaze tonight in Los Angeles. I'm expecting IG and FB to be filled with sunset shots if I know my peeps!!\", 'How the West was burned: Thousands of wildfires ablaze in #California alone http://t.co/iCSjGZ9tE1 #climate #energy http://t.co/9FxmN0l0Bd', 'Revel in yours wmv videos by means of mac farewell ablaze wmv en route to dvd: GtxRWm', \"Progressive greetings!\\n\\nIn about a month students would have set their pens ablaze in The Torch Publications'... http://t.co/9FxPiXQuJt\", 'Rene Ablaze &amp; Jacinta - Secret 2k13 (Fallen Skies Edit) - Mar 30 2013  https://t.co/7MLMsUzV1Z', \"@Navista7 Steve these fires out here are something else! California is a tinderbox - and this clown was setting my 'hood ablaze @News24680\", '#NowPlaying: Rene Ablaze &amp; Ian Buff - Magnitude http://t.co/Av2JSjfFtc  #EDM', '@nxwestmidlands huge fire at Wholesale markets ablaze http://t.co/rwzbFVNXER', \"@ablaze what time does your talk go until? I don't know if I can make it due to work.\", \"'I can't have kids cuz I got in a bicycle accident &amp; split my testicles. it's impossible for me to have kids' MICHAEL YOU ARE THE FATHER\", 'Accident on I-24 W #NashvilleTraffic. Traffic moving 8m slower than usual. https://t.co/0GHk693EgJ', 'Accident center lane blocked in #SantaClara on US-101 NB before Great America Pkwy #BayArea #Traffic http://t.co/pmlOhZuRWR', 'http://t.co/GKYe6gjTk5 Had a #personalinjury accident this summer? Read our advice &amp; see how a #solicitor can help #OtleyHour', '#stlouis #caraccidentlawyer Speeding Among Top Causes of Teen Accidents https://t.co/k4zoMOF319 https://t.co/S2kXVM0cBA Car Accident tee\\x89Û_', 'Reported motor vehicle accident in Curry on Herman Rd near Stephenson involving an overturned vehicle. Please use... http://t.co/YbJezKuRW1', 'BigRigRadio Live Accident Awareness', 'I-77 Mile Marker 31 South Mooresville  Iredell Vehicle Accident Ramp Closed at 8/6 1:18 PM', 'RT @SleepJunkies: Sleeping pills double your risk of a car accident http://t.co/7s9Nm1fiCT', \"'By accident' they knew what was gon happen https://t.co/Ysxun5vCeh\", 'Traffic accident N CABRILLO HWY/MAGELLAN AV MIR (08/06/15 11:03:58)', 'I-77 Mile Marker 31 to 40 South Mooresville  Iredell Vehicle Accident Congestion at 8/6 1:18 PM', 'the pastor was not in the scene of the accident......who was the owner of the range rover ?', \"mom: 'we didn't get home as fast as we wished' \\nme: 'why is that?'\\nmom: 'there was an accident and some truck spilt mayonnaise all over ??????\", \"I was in a horrible car accident this past Sunday. I'm finally able to get around. Thank you GOD??\", 'Can wait to see how pissed Donnie is when I tell him I was in ANOTHER accident??', \"#TruckCrash Overturns On #FortWorth Interstate http://t.co/Rs22LJ4qFp Click here if you've been in a crash&gt;http://t.co/Ld0unIYw4k\", 'Accident in #Ashville on US 23 SB before SR 752 #traffic http://t.co/hylMo0WgFI', 'Carolina accident: Motorcyclist Dies in I-540 Crash With Car That Crossed Median: A motorcycle rider traveling... http://t.co/p18lzRlmy6', 'FYI CAD:FYI: ;ACCIDENT PROPERTY DAMAGE;NHS;999 PINER RD/HORNDALE DR', 'RT nAAYf: First accident in years. Turning onto Chandanee Magu from near MMA. Taxi rammed into me while I was halfway turned. Everyone conf\\x89Û_', 'Accident left lane blocked in #Manchester on Rt 293 NB before Eddy Rd stop and go traffic back to NH-3A delay of 4 mins #traffic', ';ACCIDENT PROPERTY DAMAGE; PINER RD/HORNDALE DR', '???? it was an accident http://t.co/Oia5fxi4gM', 'FYI CAD:FYI: ;ACCIDENT PROPERTY DAMAGE;WPD;1600 S 17TH ST', '8/6/2015@2:09 PM: TRAFFIC ACCIDENT NO INJURY at 2781 WILLIS FOREMAN RD http://t.co/VCkIT6EDEv', 'Aashiqui Actress Anu Aggarwal On Her Near-Fatal Accident http://t.co/6Otfp31LqW', 'Suffield Alberta Accident https://t.co/bPTmlF4P10', '9 Mile backup on I-77 South...accident blocking the Right 2 Lanes at Exit 31 Langtree Rd...consider NC 115 or NC 150 to NC 16 as alternate', 'Has an accident changed your life? We will help you determine options that can financially support life care plans and on-going treatment.', \"#BREAKING: there was a deadly motorcycle car accident that happened to #Hagerstown today. I'll have more details at 5 @Your4State. #WHAG\", '@flowri were you marinading it or was it an accident?', \"only had a car for not even a week and got in a fucking car accident .. Mfs can't fucking drive .\", ... ]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 23
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ThYO9jt5osYn",
        "outputId": "8502f0eb-c84e-40aa-f12c-6e6163b18696"
      },
      "source": [
        "### Selection of Only one Column\n",
        "df.select_column('id')"
      ],
      "execution_count": 24,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "dtype: int\n",
              "Rows: 7613\n",
              "[1, 4, 5, 6, 7, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 28, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 44, 48, 49, 50, 52, 53, 54, 55, 56, 57, 59, 61, 62, 63, 64, 65, 66, 67, 68, 71, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 89, 91, 92, 93, 95, 96, 97, 98, 100, 102, 104, 105, 107, 109, 110, 112, 113, 114, 117, 118, 119, 120, 121, 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 143, ... ]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 24
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "CUXMLgA8oz7S",
        "outputId": "0f60683a-bb2a-4ad1-d4c0-f672f56202bc"
      },
      "source": [
        "### Selection of Multiple Columns\n",
        "df[['text','target']]"
      ],
      "execution_count": 25,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 2 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+-------------------------------+--------+\n",
              "|              text             | target |\n",
              "+-------------------------------+--------+\n",
              "| Our Deeds are the Reason o... |   1    |\n",
              "| Forest fire near La Ronge ... |   1    |\n",
              "| All residents asked to 'sh... |   1    |\n",
              "| 13,000 people receive #wil... |   1    |\n",
              "| Just got sent this photo f... |   1    |\n",
              "| #RockyFire Update => Calif... |   1    |\n",
              "| #flood #disaster Heavy rai... |   1    |\n",
              "| I'm on top of the hill and... |   1    |\n",
              "| There's an emergency evacu... |   1    |\n",
              "| I'm afraid that the tornad... |   1    |\n",
              "+-------------------------------+--------+\n",
              "[7613 rows x 2 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 25
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "8kktZNrLo5h4",
        "outputId": "4fbdbad1-17a4-4649-af4d-914661af8360"
      },
      "source": [
        "### Selection of Multiple Columns\n",
        "df.select_columns(['text','target'])"
      ],
      "execution_count": 27,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 2 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+-------------------------------+--------+\n",
              "|              text             | target |\n",
              "+-------------------------------+--------+\n",
              "| Our Deeds are the Reason o... |   1    |\n",
              "| Forest fire near La Ronge ... |   1    |\n",
              "| All residents asked to 'sh... |   1    |\n",
              "| 13,000 people receive #wil... |   1    |\n",
              "| Just got sent this photo f... |   1    |\n",
              "| #RockyFire Update => Calif... |   1    |\n",
              "| #flood #disaster Heavy rai... |   1    |\n",
              "| I'm on top of the hill and... |   1    |\n",
              "| There's an emergency evacu... |   1    |\n",
              "| I'm afraid that the tornad... |   1    |\n",
              "+-------------------------------+--------+\n",
              "[7613 rows x 2 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 27
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "wEi94rwmpAdK",
        "outputId": "286e532e-33d0-4fea-ad4a-93acfbee5134"
      },
      "source": [
        "df"
      ],
      "execution_count": 28,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">id</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">keyword</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">location</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">6</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">7</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">8</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">10</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">14</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">15</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 5 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tid\tint\n",
              "\tkeyword\tstr\n",
              "\tlocation\tstr\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "| id | keyword | location |              text             | target |\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "| 1  |         |          | Our Deeds are the Reason o... |   1    |\n",
              "| 4  |         |          | Forest fire near La Ronge ... |   1    |\n",
              "| 5  |         |          | All residents asked to 'sh... |   1    |\n",
              "| 6  |         |          | 13,000 people receive #wil... |   1    |\n",
              "| 7  |         |          | Just got sent this photo f... |   1    |\n",
              "| 8  |         |          | #RockyFire Update => Calif... |   1    |\n",
              "| 10 |         |          | #flood #disaster Heavy rai... |   1    |\n",
              "| 13 |         |          | I'm on top of the hill and... |   1    |\n",
              "| 14 |         |          | There's an emergency evacu... |   1    |\n",
              "| 15 |         |          | I'm afraid that the tornad... |   1    |\n",
              "+----+---------+----------+-------------------------------+--------+\n",
              "[7613 rows x 5 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 28
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 826
        },
        "id": "Od76OVaDpGIS",
        "outputId": "830d4167-8d66-40c0-91cf-77a049d135e4"
      },
      "source": [
        "# Plot of Value Counts\n",
        "df['target'].plot()"
      ],
      "execution_count": 29,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<pre>Materializing SArray</pre>"
            ],
            "text/plain": [
              "Materializing SArray"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>                 <body>                     <iframe style=\"border:0;margin:0\" width=\"920\" height=\"770\" srcdoc='<html lang=\"en\">                         <head>                             <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vega/5.4.0/vega.js\"></script>                             <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vega-embed/4.0.0/vega-embed.js\"></script>                             <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vega-tooltip/0.5.1/vega-tooltip.min.js\"></script>                             <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdnjs.cloudflare.com/ajax/libs/vega-tooltip/0.5.1/vega-tooltip.min.css\">                             <style>                             .vega-actions > a{                                 color:white;                                 text-decoration: none;                                 font-family: \"Arial\";                                 cursor:pointer;                                 padding:5px;                                 background:#AAAAAA;                                 border-radius:4px;                                 padding-left:10px;                                 padding-right:10px;                                 margin-right:5px;                             }                             .vega-actions{                                 margin-top:20px;                                 text-align:center                             }                            .vega-actions > a{                                 background:#999999;                            }                             </style>                         </head>                         <body>                             <div id=\"vis\">                             </div>                             <script>                                 var vega_json = \"{\\\"$schema\\\": \\\"https://vega.github.io/schema/vega/v4.json\\\", \\\"description\\\": \\\"A simple bar chart with embedded data.\\\", \\\"autosize\\\": {\\\"type\\\": \\\"fit\\\", \\\"resize\\\": false, \\\"contains\\\": \\\"padding\\\"}, \\\"width\\\": 720, \\\"height\\\": 550, \\\"padding\\\": 8, \\\"title\\\": \\\"Distribution of Values [integer]\\\", \\\"style\\\": \\\"cell\\\", \\\"signals\\\": [{\\\"name\\\": \\\"bins\\\", \\\"update\\\": \\\"data(\\\\\\\"bins_data\\\\\\\")[0]\\\"}, {\\\"name\\\": \\\"binCount\\\", \\\"update\\\": \\\"(bins.stop - bins.start) / bins.step\\\"}, {\\\"name\\\": \\\"nullGap\\\", \\\"update\\\": \\\"data(\\\\\\\"nulls\\\\\\\").length ? 10 : 0\\\"}, {\\\"name\\\": \\\"barStep\\\", \\\"update\\\": \\\"(width - nullGap) / (1 + binCount)\\\"}], \\\"data\\\": [{\\\"name\\\": \\\"source_2\\\", \\\"values\\\": [{\\\"left\\\": -9, \\\"right\\\": -8, \\\"count\\\": 0}, {\\\"left\\\": -8, \\\"right\\\": -7, \\\"count\\\": 0}, {\\\"left\\\": -7, \\\"right\\\": -6, \\\"count\\\": 0}, {\\\"left\\\": -6, \\\"right\\\": -5, \\\"count\\\": 0}, {\\\"left\\\": -5, \\\"right\\\": -4, \\\"count\\\": 0}, {\\\"left\\\": -4, \\\"right\\\": -3, \\\"count\\\": 0}, {\\\"left\\\": -3, \\\"right\\\": -2, \\\"count\\\": 0}, {\\\"left\\\": -2, \\\"right\\\": -1, \\\"count\\\": 0}, {\\\"left\\\": -1, \\\"right\\\": 0, \\\"count\\\": 0}, {\\\"left\\\": 0, \\\"right\\\": 1, \\\"count\\\": 4342}, {\\\"left\\\": 1, \\\"right\\\": 2, \\\"count\\\": 3271}, {\\\"left\\\": 2, \\\"right\\\": 3, \\\"count\\\": 0}, {\\\"left\\\": 3, \\\"right\\\": 4, \\\"count\\\": 0}, {\\\"left\\\": 4, \\\"right\\\": 5, \\\"count\\\": 0}, {\\\"left\\\": 5, \\\"right\\\": 6, \\\"count\\\": 0}, {\\\"left\\\": 6, \\\"right\\\": 7, \\\"count\\\": 0}, {\\\"left\\\": 7, \\\"right\\\": 8, \\\"count\\\": 0}, {\\\"left\\\": 8, \\\"right\\\": 9, \\\"count\\\": 0}, {\\\"left\\\": 9, \\\"right\\\": 10, \\\"count\\\": 0}, {\\\"left\\\": 10, \\\"right\\\": 11, \\\"count\\\": 0}, {\\\"start\\\": -9, \\\"stop\\\": 11, \\\"step\\\": 1}]}, {\\\"name\\\": \\\"counts\\\", \\\"source\\\": \\\"source_2\\\", \\\"transform\\\": [{\\\"type\\\": \\\"filter\\\", \\\"expr\\\": \\\"datum[\\\\\\\"missing\\\\\\\"] !== true &amp;&amp; datum[\\\\\\\"count\\\\\\\"] != null\\\"}]}, {\\\"name\\\": \\\"nulls\\\", \\\"source\\\": \\\"source_2\\\", \\\"transform\\\": [{\\\"expr\\\": \\\"datum[\\\\\\\"missing\\\\\\\"] === true &amp;&amp; datum[\\\\\\\"count\\\\\\\"] != null\\\", \\\"type\\\": \\\"filter\\\"}]}, {\\\"name\\\": \\\"bins_data\\\", \\\"source\\\": \\\"source_2\\\", \\\"transform\\\": [{\\\"expr\\\": \\\"datum[\\\\\\\"start\\\\\\\"] != null &amp;&amp; datum[\\\\\\\"stop\\\\\\\"] != null &amp;&amp; datum[\\\\\\\"step\\\\\\\"] != null\\\", \\\"type\\\": \\\"filter\\\"}]}], \\\"marks\\\": [{\\\"type\\\": \\\"rect\\\", \\\"from\\\": {\\\"data\\\": \\\"counts\\\"}, \\\"encode\\\": {\\\"update\\\": {\\\"x\\\": {\\\"scale\\\": \\\"xscale\\\", \\\"field\\\": \\\"left\\\", \\\"offset\\\": 1}, \\\"x2\\\": {\\\"scale\\\": \\\"xscale\\\", \\\"field\\\": \\\"right\\\"}, \\\"y\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"field\\\": \\\"count\\\"}, \\\"y2\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"value\\\": 0}, \\\"fill\\\": {\\\"value\\\": \\\"#108EE9\\\"}}, \\\"hover\\\": {\\\"fill\\\": {\\\"value\\\": \\\"#7EC2F3\\\"}}}}, {\\\"type\\\": \\\"rect\\\", \\\"from\\\": {\\\"data\\\": \\\"nulls\\\"}, \\\"encode\\\": {\\\"update\\\": {\\\"x\\\": {\\\"scale\\\": \\\"xscale-null\\\", \\\"value\\\": null, \\\"offset\\\": 1}, \\\"x2\\\": {\\\"scale\\\": \\\"xscale-null\\\", \\\"band\\\": 1}, \\\"y\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"field\\\": \\\"count\\\"}, \\\"y2\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"value\\\": 0}, \\\"fill\\\": {\\\"value\\\": \\\"#108EE9\\\"}}, \\\"hover\\\": {\\\"fill\\\": {\\\"value\\\": \\\"#7EC2F3\\\"}}}}], \\\"scales\\\": [{\\\"name\\\": \\\"yscale\\\", \\\"type\\\": \\\"linear\\\", \\\"range\\\": \\\"height\\\", \\\"round\\\": true, \\\"nice\\\": true, \\\"domain\\\": {\\\"fields\\\": [{\\\"data\\\": \\\"counts\\\", \\\"field\\\": \\\"count\\\"}, {\\\"data\\\": \\\"nulls\\\", \\\"field\\\": \\\"count\\\"}]}}, {\\\"name\\\": \\\"xscale\\\", \\\"type\\\": \\\"linear\\\", \\\"range\\\": [{\\\"signal\\\": \\\"nullGap ? barStep + nullGap : 0\\\"}, {\\\"signal\\\": \\\"width\\\"}], \\\"round\\\": true, \\\"domain\\\": {\\\"signal\\\": \\\"[bins.start, bins.stop]\\\"}, \\\"bins\\\": {\\\"signal\\\": \\\"bins\\\"}}, {\\\"name\\\": \\\"xscale-null\\\", \\\"type\\\": \\\"band\\\", \\\"range\\\": [{\\\"signal\\\": \\\"nullGap ? 0 : 1\\\"}, {\\\"signal\\\": \\\"nullGap ? barStep : 0\\\"}], \\\"round\\\": true, \\\"domain\\\": [{\\\"signal\\\": \\\"nullGap ? null : &apos;&apos;\\\"}]}], \\\"axes\\\": [{\\\"title\\\": \\\"Values\\\", \\\"orient\\\": \\\"bottom\\\", \\\"scale\\\": \\\"xscale\\\", \\\"tickMinStep\\\": 1, \\\"grid\\\": true}, {\\\"orient\\\": \\\"bottom\\\", \\\"scale\\\": \\\"xscale-null\\\"}, {\\\"title\\\": \\\"Count\\\", \\\"orient\\\": \\\"left\\\", \\\"scale\\\": \\\"yscale\\\", \\\"tickCount\\\": 5, \\\"offset\\\": {\\\"signal\\\": \\\"nullGap ? 5 : 0\\\"}, \\\"grid\\\": true}], \\\"config\\\": {\\\"axis\\\": {\\\"gridColor\\\": \\\"rgba(204,204,204,1.0)\\\", \\\"labelFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"labelFontSize\\\": 12, \\\"labelPadding\\\": 10, \\\"labelColor\\\": \\\"rgba(0,0,0,0.847)\\\", \\\"tickColor\\\": \\\"rgb(136,136,136)\\\", \\\"titleFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"titleFontWeight\\\": \\\"normal\\\", \\\"titlePadding\\\": 20, \\\"titleFontSize\\\": 14, \\\"titleColor\\\": \\\"rgba(0,0,0,0.847)\\\"}, \\\"axisY\\\": {\\\"minExtent\\\": 30}, \\\"legend\\\": {\\\"labelFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"labelColor\\\": \\\"rgba(0,0,0,0.847)\\\", \\\"titleFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"cornerRadius\\\": 30, \\\"gradientLength\\\": 608, \\\"titleColor\\\": \\\"rgba(0,0,0,0.847)\\\"}, \\\"range\\\": {\\\"heatmap\\\": {\\\"scheme\\\": \\\"greenblue\\\"}}, \\\"style\\\": {\\\"rect\\\": {\\\"stroke\\\": \\\"rgba(200, 200, 200, 0.5)\\\"}, \\\"cell\\\": {\\\"stroke\\\": \\\"transparent\\\"}, \\\"group-title\\\": {\\\"fontSize\\\": 29, \\\"font\\\": \\\"HelveticaNeue, Arial\\\", \\\"fontWeight\\\": \\\"normal\\\", \\\"fill\\\": \\\"rgba(0,0,0,0.65)\\\"}}, \\\"title\\\": {\\\"color\\\": \\\"rgba(0,0,0,0.847)\\\", \\\"font\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"fontSize\\\": 18, \\\"fontWeight\\\": \\\"normal\\\", \\\"offset\\\": 30}}}\";                                 var vega_json_parsed = JSON.parse(vega_json);                                 var toolTipOpts = {                                     showAllFields: true                                 };                                 if(vega_json_parsed[\"metadata\"] != null){                                     if(vega_json_parsed[\"metadata\"][\"bubbleOpts\"] != null){                                         toolTipOpts = vega_json_parsed[\"metadata\"][\"bubbleOpts\"];                                     };                                 };                                 vegaEmbed(\"#vis\", vega_json_parsed).then(function (result) {                                     vegaTooltip.vega(result.view, toolTipOpts);                                  });                             </script>                         </body>                     </html>' src=\"demo_iframe_srcdoc.htm\">                         <p>Your browser does not support iframes.</p>                     </iframe>                 </body>             </html>"
            ],
            "text/plain": [
              "<IPython.core.display.HTML object>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "<turicreate.visualization._plot.Plot at 0x7fb5bbc94610>"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 29
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "IDATc94zpUDq",
        "outputId": "8b14992e-da0b-4e03-e9c0-c64f5e191b98"
      },
      "source": [
        "dir(df)"
      ],
      "execution_count": 30,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "['_SFrame__dropna_errchk',\n",
              " '__add__',\n",
              " '__class__',\n",
              " '__copy__',\n",
              " '__deepcopy__',\n",
              " '__delattr__',\n",
              " '__delitem__',\n",
              " '__dir__',\n",
              " '__doc__',\n",
              " '__eq__',\n",
              " '__format__',\n",
              " '__ge__',\n",
              " '__get_column_description__',\n",
              " '__get_pretty_tables__',\n",
              " '__getattribute__',\n",
              " '__getitem__',\n",
              " '__gt__',\n",
              " '__has_size__',\n",
              " '__hash__',\n",
              " '__init__',\n",
              " '__init_subclass__',\n",
              " '__is_materialized__',\n",
              " '__iter__',\n",
              " '__le__',\n",
              " '__len__',\n",
              " '__lt__',\n",
              " '__module__',\n",
              " '__ne__',\n",
              " '__new__',\n",
              " '__nonzero__',\n",
              " '__proxy__',\n",
              " '__query_plan_str__',\n",
              " '__reduce__',\n",
              " '__reduce_ex__',\n",
              " '__repr__',\n",
              " '__setattr__',\n",
              " '__setitem__',\n",
              " '__sizeof__',\n",
              " '__slots__',\n",
              " '__str__',\n",
              " '__str_impl__',\n",
              " '__subclasshook__',\n",
              " '_cache',\n",
              " '_imagecols_to_stringcols',\n",
              " '_infer_column_types_from_lines',\n",
              " '_proxy',\n",
              " '_read_csv_impl',\n",
              " '_repr_html_',\n",
              " '_row_selector',\n",
              " '_save_reference',\n",
              " 'add_column',\n",
              " 'add_columns',\n",
              " 'add_row_number',\n",
              " 'append',\n",
              " 'apply',\n",
              " 'column_names',\n",
              " 'column_types',\n",
              " 'copy',\n",
              " 'drop_duplicates',\n",
              " 'dropna',\n",
              " 'dropna_split',\n",
              " 'dtype',\n",
              " 'explore',\n",
              " 'export_csv',\n",
              " 'export_json',\n",
              " 'fillna',\n",
              " 'filter_by',\n",
              " 'flat_map',\n",
              " 'from_sql',\n",
              " 'groupby',\n",
              " 'head',\n",
              " 'is_materialized',\n",
              " 'join',\n",
              " 'materialize',\n",
              " 'num_columns',\n",
              " 'num_rows',\n",
              " 'pack_columns',\n",
              " 'plot',\n",
              " 'print_rows',\n",
              " 'random_split',\n",
              " 'read_csv',\n",
              " 'read_csv_with_errors',\n",
              " 'read_json',\n",
              " 'remove_column',\n",
              " 'remove_columns',\n",
              " 'rename',\n",
              " 'sample',\n",
              " 'save',\n",
              " 'select_column',\n",
              " 'select_columns',\n",
              " 'shape',\n",
              " 'show',\n",
              " 'shuffle',\n",
              " 'sort',\n",
              " 'split_datetime',\n",
              " 'stack',\n",
              " 'swap_columns',\n",
              " 'tail',\n",
              " 'to_dataframe',\n",
              " 'to_numpy',\n",
              " 'to_sql',\n",
              " 'topk',\n",
              " 'unique',\n",
              " 'unpack',\n",
              " 'unstack']"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 30
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "FTv3fwkSpdpF",
        "outputId": "14bc04c2-7201-4908-d873-6c42ab7e2d70"
      },
      "source": [
        "df['target'].unique()"
      ],
      "execution_count": 31,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "dtype: int\n",
              "Rows: 2\n",
              "[0, 1]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 31
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "r5vhpEU9pm9A",
        "outputId": "a7817e7d-a38f-4adf-df5b-1313d5330ea7"
      },
      "source": [
        "# Apply a fxn\n",
        "df['text'].apply(lambda x: str(x).lower())"
      ],
      "execution_count": 39,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "dtype: str\n",
              "Rows: 7613\n",
              "['our deeds are the reason of this #earthquake may allah forgive us all', 'forest fire near la ronge sask. canada', \"all residents asked to 'shelter in place' are being notified by officers. no other evacuation or shelter in place orders are expected\", '13,000 people receive #wildfires evacuation orders in california ', 'just got sent this photo from ruby #alaska as smoke from #wildfires pours into a school', '#rockyfire update => california hwy. 20 closed in both directions due to lake county fire - #cafire #wildfires', '#flood #disaster heavy rain causes flash flooding of streets in manitou, colorado springs areas', \"i'm on top of the hill and i can see a fire in the woods...\", \"there's an emergency evacuation happening now in the building across the street\", \"i'm afraid that the tornado is coming to our area...\", 'three people died from the heat wave so far', 'haha south tampa is getting flooded hah- wait a second i live in south tampa what am i gonna do what am i gonna do fvck #flooding', \"#raining #flooding #florida #tampabay #tampa 18 or 19 days. i've lost count\", '#flood in bago myanmar #we arrived bago', 'damage to school bus on 80 in multi car crash #breaking', \"what's up man?\", 'i love fruits', 'summer is lovely', 'my car is so fast', 'what a goooooooaaaaaal!!!!!!', 'this is ridiculous....', 'london is cool ;)', 'love skiing', 'what a wonderful day!', 'looooool', \"no way...i can't eat that shit\", 'was in nyc last week!', 'love my girlfriend', 'cooool :)', 'do you like pasta?', 'the end!', '@bbcmtd wholesale markets ablaze http://t.co/lhyxeohy6c', 'we always try to bring the heavy. #metal #rt http://t.co/yao1e0xngw', '#africanbaze: breaking news:nigeria flag set ablaze in aba. http://t.co/2nndbgwyei', 'crying out for more! set me ablaze', 'on plus side look at the sky last night it was ablaze http://t.co/qqsmshaj3n', \"@phdsquares #mufc they've built so much hype around new acquisitions but i doubt they will set the epl ablaze this season.\", 'inec office in abia set ablaze - http://t.co/3imaomknna', 'barbados #bridgetown jamaica \\x89ûò two cars set ablaze: santa cruz \\x89ûó head of the st elizabeth police superintende...  http://t.co/wdueaj8q4j', 'ablaze for you lord :d', 'check these out: http://t.co/roi2nsmejj http://t.co/3tj8zjin21 http://t.co/yduixefipe http://t.co/lxtjc87kls #nsfw', \"on the outside you're ablaze and alive\\nbut you're dead inside\", 'had an awesome time visiting the cfc head office the ancop site and ablaze. thanks to tita vida for taking care of us ??', 'soooo pumped for ablaze ???? @southridgelife', 'i wanted to set chicago ablaze with my preaching... but not my hotel! http://t.co/o9qknbfofx', 'i gained 3 followers in the last week. you? know your stats and grow with http://t.co/tiyulif5c6', 'how the west was burned: thousands of wildfires ablaze in california alone http://t.co/vl5tbr3wbr', 'building the perfect tracklist to life leave the streets ablaze', 'check these out: http://t.co/roi2nsmejj http://t.co/3tj8zjin21 http://t.co/yduixefipe http://t.co/lxtjc87kls #nsfw', \"first night with retainers in. it's quite weird. better get used to it; i have to wear them every single night for the next year at least.\", 'deputies: man shot before brighton home set ablaze http://t.co/gwnrhmso8k', 'man wife get six years jail for setting ablaze niece\\nhttp://t.co/ev1ahoucza', 'santa cruz \\x89ûó head of the st elizabeth police superintendent lanford salmon has r ... - http://t.co/vplr5hka2u http://t.co/sxhw2tnnlf', 'police: arsonist deliberately set black church in north carolinaåêablaze http://t.co/pcxarbh9an', \"noches el-bestia '@alexis_sanchez: happy to see my teammates and training hard ?? goodnight gunners.?????? http://t.co/uc4j4jhvgr'\", '#kurds trampling on turkmen flag later set it ablaze while others vandalized offices of turkmen front in #diyala http://t.co/4izfdyc3cg', 'truck ablaze : r21. voortrekker ave. outside or tambo intl. cargo section. http://t.co/8kscqkfkkf', 'set our hearts ablaze and every city was a gift and every skyline was like a kiss upon the lips @\\x89û_ https://t.co/cyompz1a0z', \"they sky was ablaze tonight in los angeles. i'm expecting ig and fb to be filled with sunset shots if i know my peeps!!\", 'how the west was burned: thousands of wildfires ablaze in #california alone http://t.co/icsjgz9te1 #climate #energy http://t.co/9fxmn0l0bd', 'revel in yours wmv videos by means of mac farewell ablaze wmv en route to dvd: gtxrwm', \"progressive greetings!\\n\\nin about a month students would have set their pens ablaze in the torch publications'... http://t.co/9fxpixqujt\", 'rene ablaze &amp; jacinta - secret 2k13 (fallen skies edit) - mar 30 2013  https://t.co/7mlmsuzv1z', \"@navista7 steve these fires out here are something else! california is a tinderbox - and this clown was setting my 'hood ablaze @news24680\", '#nowplaying: rene ablaze &amp; ian buff - magnitude http://t.co/av2jsjfftc  #edm', '@nxwestmidlands huge fire at wholesale markets ablaze http://t.co/rwzbfvnxer', \"@ablaze what time does your talk go until? i don't know if i can make it due to work.\", \"'i can't have kids cuz i got in a bicycle accident &amp; split my testicles. it's impossible for me to have kids' michael you are the father\", 'accident on i-24 w #nashvilletraffic. traffic moving 8m slower than usual. https://t.co/0ghk693egj', 'accident center lane blocked in #santaclara on us-101 nb before great america pkwy #bayarea #traffic http://t.co/pmlohzurwr', 'http://t.co/gkye6gjtk5 had a #personalinjury accident this summer? read our advice &amp; see how a #solicitor can help #otleyhour', '#stlouis #caraccidentlawyer speeding among top causes of teen accidents https://t.co/k4zomof319 https://t.co/s2kxvm0cba car accident tee\\x89û_', 'reported motor vehicle accident in curry on herman rd near stephenson involving an overturned vehicle. please use... http://t.co/ybjezkurw1', 'bigrigradio live accident awareness', 'i-77 mile marker 31 south mooresville  iredell vehicle accident ramp closed at 8/6 1:18 pm', 'rt @sleepjunkies: sleeping pills double your risk of a car accident http://t.co/7s9nm1fict', \"'by accident' they knew what was gon happen https://t.co/ysxun5vceh\", 'traffic accident n cabrillo hwy/magellan av mir (08/06/15 11:03:58)', 'i-77 mile marker 31 to 40 south mooresville  iredell vehicle accident congestion at 8/6 1:18 pm', 'the pastor was not in the scene of the accident......who was the owner of the range rover ?', \"mom: 'we didn't get home as fast as we wished' \\nme: 'why is that?'\\nmom: 'there was an accident and some truck spilt mayonnaise all over ??????\", \"i was in a horrible car accident this past sunday. i'm finally able to get around. thank you god??\", 'can wait to see how pissed donnie is when i tell him i was in another accident??', \"#truckcrash overturns on #fortworth interstate http://t.co/rs22lj4qfp click here if you've been in a crash&gt;http://t.co/ld0uniyw4k\", 'accident in #ashville on us 23 sb before sr 752 #traffic http://t.co/hylmo0wgfi', 'carolina accident: motorcyclist dies in i-540 crash with car that crossed median: a motorcycle rider traveling... http://t.co/p18lzrlmy6', 'fyi cad:fyi: ;accident property damage;nhs;999 piner rd/horndale dr', 'rt naayf: first accident in years. turning onto chandanee magu from near mma. taxi rammed into me while i was halfway turned. everyone conf\\x89û_', 'accident left lane blocked in #manchester on rt 293 nb before eddy rd stop and go traffic back to nh-3a delay of 4 mins #traffic', ';accident property damage; piner rd/horndale dr', '???? it was an accident http://t.co/oia5fxi4gm', 'fyi cad:fyi: ;accident property damage;wpd;1600 s 17th st', '8/6/2015@2:09 pm: traffic accident no injury at 2781 willis foreman rd http://t.co/vckit6edev', 'aashiqui actress anu aggarwal on her near-fatal accident http://t.co/6otfp31lqw', 'suffield alberta accident https://t.co/bptmlf4p10', '9 mile backup on i-77 south...accident blocking the right 2 lanes at exit 31 langtree rd...consider nc 115 or nc 150 to nc 16 as alternate', 'has an accident changed your life? we will help you determine options that can financially support life care plans and on-going treatment.', \"#breaking: there was a deadly motorcycle car accident that happened to #hagerstown today. i'll have more details at 5 @your4state. #whag\", '@flowri were you marinading it or was it an accident?', \"only had a car for not even a week and got in a fucking car accident .. mfs can't fucking drive .\", ... ]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 39
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 808
        },
        "id": "Apcr_7Y8ps_j",
        "outputId": "3d858ae2-15d5-41de-eaba-729477502e77"
      },
      "source": [
        "# Show value counts of a column\n",
        "df['target'].show()"
      ],
      "execution_count": 40,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<pre>Materializing SArray</pre>"
            ],
            "text/plain": [
              "Materializing SArray"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "<html>                 <body>                     <iframe style=\"border:0;margin:0\" width=\"920\" height=\"770\" srcdoc='<html lang=\"en\">                         <head>                             <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vega/5.4.0/vega.js\"></script>                             <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vega-embed/4.0.0/vega-embed.js\"></script>                             <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vega-tooltip/0.5.1/vega-tooltip.min.js\"></script>                             <link rel=\"stylesheet\" type=\"text/css\" href=\"https://cdnjs.cloudflare.com/ajax/libs/vega-tooltip/0.5.1/vega-tooltip.min.css\">                             <style>                             .vega-actions > a{                                 color:white;                                 text-decoration: none;                                 font-family: \"Arial\";                                 cursor:pointer;                                 padding:5px;                                 background:#AAAAAA;                                 border-radius:4px;                                 padding-left:10px;                                 padding-right:10px;                                 margin-right:5px;                             }                             .vega-actions{                                 margin-top:20px;                                 text-align:center                             }                            .vega-actions > a{                                 background:#999999;                            }                             </style>                         </head>                         <body>                             <div id=\"vis\">                             </div>                             <script>                                 var vega_json = \"{\\\"$schema\\\": \\\"https://vega.github.io/schema/vega/v4.json\\\", \\\"description\\\": \\\"A simple bar chart with embedded data.\\\", \\\"autosize\\\": {\\\"type\\\": \\\"fit\\\", \\\"resize\\\": false, \\\"contains\\\": \\\"padding\\\"}, \\\"width\\\": 720, \\\"height\\\": 550, \\\"padding\\\": 8, \\\"title\\\": \\\"Distribution of Values [integer]\\\", \\\"style\\\": \\\"cell\\\", \\\"signals\\\": [{\\\"name\\\": \\\"bins\\\", \\\"update\\\": \\\"data(\\\\\\\"bins_data\\\\\\\")[0]\\\"}, {\\\"name\\\": \\\"binCount\\\", \\\"update\\\": \\\"(bins.stop - bins.start) / bins.step\\\"}, {\\\"name\\\": \\\"nullGap\\\", \\\"update\\\": \\\"data(\\\\\\\"nulls\\\\\\\").length ? 10 : 0\\\"}, {\\\"name\\\": \\\"barStep\\\", \\\"update\\\": \\\"(width - nullGap) / (1 + binCount)\\\"}], \\\"data\\\": [{\\\"name\\\": \\\"source_2\\\", \\\"values\\\": [{\\\"left\\\": -9, \\\"right\\\": -8, \\\"count\\\": 0}, {\\\"left\\\": -8, \\\"right\\\": -7, \\\"count\\\": 0}, {\\\"left\\\": -7, \\\"right\\\": -6, \\\"count\\\": 0}, {\\\"left\\\": -6, \\\"right\\\": -5, \\\"count\\\": 0}, {\\\"left\\\": -5, \\\"right\\\": -4, \\\"count\\\": 0}, {\\\"left\\\": -4, \\\"right\\\": -3, \\\"count\\\": 0}, {\\\"left\\\": -3, \\\"right\\\": -2, \\\"count\\\": 0}, {\\\"left\\\": -2, \\\"right\\\": -1, \\\"count\\\": 0}, {\\\"left\\\": -1, \\\"right\\\": 0, \\\"count\\\": 0}, {\\\"left\\\": 0, \\\"right\\\": 1, \\\"count\\\": 4342}, {\\\"left\\\": 1, \\\"right\\\": 2, \\\"count\\\": 3271}, {\\\"left\\\": 2, \\\"right\\\": 3, \\\"count\\\": 0}, {\\\"left\\\": 3, \\\"right\\\": 4, \\\"count\\\": 0}, {\\\"left\\\": 4, \\\"right\\\": 5, \\\"count\\\": 0}, {\\\"left\\\": 5, \\\"right\\\": 6, \\\"count\\\": 0}, {\\\"left\\\": 6, \\\"right\\\": 7, \\\"count\\\": 0}, {\\\"left\\\": 7, \\\"right\\\": 8, \\\"count\\\": 0}, {\\\"left\\\": 8, \\\"right\\\": 9, \\\"count\\\": 0}, {\\\"left\\\": 9, \\\"right\\\": 10, \\\"count\\\": 0}, {\\\"left\\\": 10, \\\"right\\\": 11, \\\"count\\\": 0}, {\\\"start\\\": -9, \\\"stop\\\": 11, \\\"step\\\": 1}]}, {\\\"name\\\": \\\"counts\\\", \\\"source\\\": \\\"source_2\\\", \\\"transform\\\": [{\\\"type\\\": \\\"filter\\\", \\\"expr\\\": \\\"datum[\\\\\\\"missing\\\\\\\"] !== true &amp;&amp; datum[\\\\\\\"count\\\\\\\"] != null\\\"}]}, {\\\"name\\\": \\\"nulls\\\", \\\"source\\\": \\\"source_2\\\", \\\"transform\\\": [{\\\"expr\\\": \\\"datum[\\\\\\\"missing\\\\\\\"] === true &amp;&amp; datum[\\\\\\\"count\\\\\\\"] != null\\\", \\\"type\\\": \\\"filter\\\"}]}, {\\\"name\\\": \\\"bins_data\\\", \\\"source\\\": \\\"source_2\\\", \\\"transform\\\": [{\\\"expr\\\": \\\"datum[\\\\\\\"start\\\\\\\"] != null &amp;&amp; datum[\\\\\\\"stop\\\\\\\"] != null &amp;&amp; datum[\\\\\\\"step\\\\\\\"] != null\\\", \\\"type\\\": \\\"filter\\\"}]}], \\\"marks\\\": [{\\\"type\\\": \\\"rect\\\", \\\"from\\\": {\\\"data\\\": \\\"counts\\\"}, \\\"encode\\\": {\\\"update\\\": {\\\"x\\\": {\\\"scale\\\": \\\"xscale\\\", \\\"field\\\": \\\"left\\\", \\\"offset\\\": 1}, \\\"x2\\\": {\\\"scale\\\": \\\"xscale\\\", \\\"field\\\": \\\"right\\\"}, \\\"y\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"field\\\": \\\"count\\\"}, \\\"y2\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"value\\\": 0}, \\\"fill\\\": {\\\"value\\\": \\\"#108EE9\\\"}}, \\\"hover\\\": {\\\"fill\\\": {\\\"value\\\": \\\"#7EC2F3\\\"}}}}, {\\\"type\\\": \\\"rect\\\", \\\"from\\\": {\\\"data\\\": \\\"nulls\\\"}, \\\"encode\\\": {\\\"update\\\": {\\\"x\\\": {\\\"scale\\\": \\\"xscale-null\\\", \\\"value\\\": null, \\\"offset\\\": 1}, \\\"x2\\\": {\\\"scale\\\": \\\"xscale-null\\\", \\\"band\\\": 1}, \\\"y\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"field\\\": \\\"count\\\"}, \\\"y2\\\": {\\\"scale\\\": \\\"yscale\\\", \\\"value\\\": 0}, \\\"fill\\\": {\\\"value\\\": \\\"#108EE9\\\"}}, \\\"hover\\\": {\\\"fill\\\": {\\\"value\\\": \\\"#7EC2F3\\\"}}}}], \\\"scales\\\": [{\\\"name\\\": \\\"yscale\\\", \\\"type\\\": \\\"linear\\\", \\\"range\\\": \\\"height\\\", \\\"round\\\": true, \\\"nice\\\": true, \\\"domain\\\": {\\\"fields\\\": [{\\\"data\\\": \\\"counts\\\", \\\"field\\\": \\\"count\\\"}, {\\\"data\\\": \\\"nulls\\\", \\\"field\\\": \\\"count\\\"}]}}, {\\\"name\\\": \\\"xscale\\\", \\\"type\\\": \\\"linear\\\", \\\"range\\\": [{\\\"signal\\\": \\\"nullGap ? barStep + nullGap : 0\\\"}, {\\\"signal\\\": \\\"width\\\"}], \\\"round\\\": true, \\\"domain\\\": {\\\"signal\\\": \\\"[bins.start, bins.stop]\\\"}, \\\"bins\\\": {\\\"signal\\\": \\\"bins\\\"}}, {\\\"name\\\": \\\"xscale-null\\\", \\\"type\\\": \\\"band\\\", \\\"range\\\": [{\\\"signal\\\": \\\"nullGap ? 0 : 1\\\"}, {\\\"signal\\\": \\\"nullGap ? barStep : 0\\\"}], \\\"round\\\": true, \\\"domain\\\": [{\\\"signal\\\": \\\"nullGap ? null : &apos;&apos;\\\"}]}], \\\"axes\\\": [{\\\"title\\\": \\\"Values\\\", \\\"orient\\\": \\\"bottom\\\", \\\"scale\\\": \\\"xscale\\\", \\\"tickMinStep\\\": 1, \\\"grid\\\": true}, {\\\"orient\\\": \\\"bottom\\\", \\\"scale\\\": \\\"xscale-null\\\"}, {\\\"title\\\": \\\"Count\\\", \\\"orient\\\": \\\"left\\\", \\\"scale\\\": \\\"yscale\\\", \\\"tickCount\\\": 5, \\\"offset\\\": {\\\"signal\\\": \\\"nullGap ? 5 : 0\\\"}, \\\"grid\\\": true}], \\\"config\\\": {\\\"axis\\\": {\\\"gridColor\\\": \\\"rgba(204,204,204,1.0)\\\", \\\"labelFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"labelFontSize\\\": 12, \\\"labelPadding\\\": 10, \\\"labelColor\\\": \\\"rgba(0,0,0,0.847)\\\", \\\"tickColor\\\": \\\"rgb(136,136,136)\\\", \\\"titleFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"titleFontWeight\\\": \\\"normal\\\", \\\"titlePadding\\\": 20, \\\"titleFontSize\\\": 14, \\\"titleColor\\\": \\\"rgba(0,0,0,0.847)\\\"}, \\\"axisY\\\": {\\\"minExtent\\\": 30}, \\\"legend\\\": {\\\"labelFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"labelColor\\\": \\\"rgba(0,0,0,0.847)\\\", \\\"titleFont\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"cornerRadius\\\": 30, \\\"gradientLength\\\": 608, \\\"titleColor\\\": \\\"rgba(0,0,0,0.847)\\\"}, \\\"range\\\": {\\\"heatmap\\\": {\\\"scheme\\\": \\\"greenblue\\\"}}, \\\"style\\\": {\\\"rect\\\": {\\\"stroke\\\": \\\"rgba(200, 200, 200, 0.5)\\\"}, \\\"cell\\\": {\\\"stroke\\\": \\\"transparent\\\"}, \\\"group-title\\\": {\\\"fontSize\\\": 29, \\\"font\\\": \\\"HelveticaNeue, Arial\\\", \\\"fontWeight\\\": \\\"normal\\\", \\\"fill\\\": \\\"rgba(0,0,0,0.65)\\\"}}, \\\"title\\\": {\\\"color\\\": \\\"rgba(0,0,0,0.847)\\\", \\\"font\\\": \\\"\\\\\\\"San Francisco\\\\\\\", HelveticaNeue, Arial\\\", \\\"fontSize\\\": 18, \\\"fontWeight\\\": \\\"normal\\\", \\\"offset\\\": 30}}}\";                                 var vega_json_parsed = JSON.parse(vega_json);                                 var toolTipOpts = {                                     showAllFields: true                                 };                                 if(vega_json_parsed[\"metadata\"] != null){                                     if(vega_json_parsed[\"metadata\"][\"bubbleOpts\"] != null){                                         toolTipOpts = vega_json_parsed[\"metadata\"][\"bubbleOpts\"];                                     };                                 };                                 vegaEmbed(\"#vis\", vega_json_parsed).then(function (result) {                                     vegaTooltip.vega(result.view, toolTipOpts);                                  });                             </script>                         </body>                     </html>' src=\"demo_iframe_srcdoc.htm\">                         <p>Your browser does not support iframes.</p>                     </iframe>                 </body>             </html>"
            ],
            "text/plain": [
              "<IPython.core.display.HTML object>"
            ]
          },
          "metadata": {
            "tags": []
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "5oOsejKcqdKF",
        "outputId": "51311a9a-6196-4665-bb89-64b6a32a0275"
      },
      "source": [
        "# Remove/Delete Columns\n",
        "df.remove_column('id')"
      ],
      "execution_count": 41,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">keyword</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">location</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\"></td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 4 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tkeyword\tstr\n",
              "\tlocation\tstr\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+---------+----------+-------------------------------+--------+\n",
              "| keyword | location |              text             | target |\n",
              "+---------+----------+-------------------------------+--------+\n",
              "|         |          | Our Deeds are the Reason o... |   1    |\n",
              "|         |          | Forest fire near La Ronge ... |   1    |\n",
              "|         |          | All residents asked to 'sh... |   1    |\n",
              "|         |          | 13,000 people receive #wil... |   1    |\n",
              "|         |          | Just got sent this photo f... |   1    |\n",
              "|         |          | #RockyFire Update => Calif... |   1    |\n",
              "|         |          | #flood #disaster Heavy rai... |   1    |\n",
              "|         |          | I'm on top of the hill and... |   1    |\n",
              "|         |          | There's an emergency evacu... |   1    |\n",
              "|         |          | I'm afraid that the tornad... |   1    |\n",
              "+---------+----------+-------------------------------+--------+\n",
              "[7613 rows x 4 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 41
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "NoSRPA6aqsJ8",
        "outputId": "d2506d27-3ec7-4118-a0af-90d27904a6fc"
      },
      "source": [
        "# Remove Multiple Columns\n",
        "df.remove_columns(['keyword','location'],inplace=True)"
      ],
      "execution_count": 42,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">id</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">6</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">7</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">8</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">10</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">14</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">15</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 3 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tid\tint\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+----+-------------------------------+--------+\n",
              "| id |              text             | target |\n",
              "+----+-------------------------------+--------+\n",
              "| 1  | Our Deeds are the Reason o... |   1    |\n",
              "| 4  | Forest fire near La Ronge ... |   1    |\n",
              "| 5  | All residents asked to 'sh... |   1    |\n",
              "| 6  | 13,000 people receive #wil... |   1    |\n",
              "| 7  | Just got sent this photo f... |   1    |\n",
              "| 8  | #RockyFire Update => Calif... |   1    |\n",
              "| 10 | #flood #disaster Heavy rai... |   1    |\n",
              "| 13 | I'm on top of the hill and... |   1    |\n",
              "| 14 | There's an emergency evacu... |   1    |\n",
              "| 15 | I'm afraid that the tornad... |   1    |\n",
              "+----+-------------------------------+--------+\n",
              "[7613 rows x 3 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 42
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "QW54AJEfq5Hg",
        "outputId": "b6bc19dd-705b-49df-c8b8-cc485e70a81c"
      },
      "source": [
        "df"
      ],
      "execution_count": 43,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">id</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">6</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">7</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">8</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">10</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">14</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">15</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 3 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tid\tint\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+----+-------------------------------+--------+\n",
              "| id |              text             | target |\n",
              "+----+-------------------------------+--------+\n",
              "| 1  | Our Deeds are the Reason o... |   1    |\n",
              "| 4  | Forest fire near La Ronge ... |   1    |\n",
              "| 5  | All residents asked to 'sh... |   1    |\n",
              "| 6  | 13,000 people receive #wil... |   1    |\n",
              "| 7  | Just got sent this photo f... |   1    |\n",
              "| 8  | #RockyFire Update => Calif... |   1    |\n",
              "| 10 | #flood #disaster Heavy rai... |   1    |\n",
              "| 13 | I'm on top of the hill and... |   1    |\n",
              "| 14 | There's an emergency evacu... |   1    |\n",
              "| 15 | I'm afraid that the tornad... |   1    |\n",
              "+----+-------------------------------+--------+\n",
              "[7613 rows x 3 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 43
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "hsF9qBwtqVh0"
      },
      "source": [
        "# Save Dataset\n",
        "df.save('disaster_data.csv')"
      ],
      "execution_count": 44,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Vt_9eoeTrCgM"
      },
      "source": [
        "df.save('disaster_data2.sframe')"
      ],
      "execution_count": 45,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "sn3KuDA9rGen"
      },
      "source": [
        "# Reload data\n",
        "df2 = tc.load_sframe('disaster_data2.sframe')"
      ],
      "execution_count": 46,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 454
        },
        "id": "HEVQA8edrh19",
        "outputId": "82353b55-880a-4f2d-8b82-57db1401d974"
      },
      "source": [
        "df2"
      ],
      "execution_count": 47,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\"><table frame=\"box\" rules=\"cols\">\n",
              "    <tr>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">id</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">text</th>\n",
              "        <th style=\"padding-left: 1em; padding-right: 1em; text-align: center\">target</th>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Our Deeds are the Reason<br>of this #earthquake May ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">4</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Forest fire near La Ronge<br>Sask. Canada ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">5</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">All residents asked to<br>&#x27;shelter in place&#x27; are ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">6</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13,000 people receive<br>#wildfires evacuation ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">7</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">Just got sent this photo<br>from Ruby #Alaska as ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">8</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#RockyFire Update =&gt;<br>California Hwy. 20 cl ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">10</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">#flood #disaster Heavy<br>rain causes flash ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">13</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m on top of the hill<br>and I can see a fire in ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">14</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">There&#x27;s an emergency<br>evacuation happening now ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">15</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">I&#x27;m afraid that the<br>tornado is coming to our ...</td>\n",
              "        <td style=\"padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: top\">1</td>\n",
              "    </tr>\n",
              "</table>\n",
              "[7613 rows x 3 columns]<br/>Note: Only the head of the SFrame is printed.<br/>You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.\n",
              "</div>"
            ],
            "text/plain": [
              "Columns:\n",
              "\tid\tint\n",
              "\ttext\tstr\n",
              "\ttarget\tint\n",
              "\n",
              "Rows: 7613\n",
              "\n",
              "Data:\n",
              "+----+-------------------------------+--------+\n",
              "| id |              text             | target |\n",
              "+----+-------------------------------+--------+\n",
              "| 1  | Our Deeds are the Reason o... |   1    |\n",
              "| 4  | Forest fire near La Ronge ... |   1    |\n",
              "| 5  | All residents asked to 'sh... |   1    |\n",
              "| 6  | 13,000 people receive #wil... |   1    |\n",
              "| 7  | Just got sent this photo f... |   1    |\n",
              "| 8  | #RockyFire Update => Calif... |   1    |\n",
              "| 10 | #flood #disaster Heavy rai... |   1    |\n",
              "| 13 | I'm on top of the hill and... |   1    |\n",
              "| 14 | There's an emergency evacu... |   1    |\n",
              "| 15 | I'm afraid that the tornad... |   1    |\n",
              "+----+-------------------------------+--------+\n",
              "[7613 rows x 3 columns]\n",
              "Note: Only the head of the SFrame is printed.\n",
              "You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns."
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 47
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "lRlLMxtirjrJ"
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}